<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="https://www.thymeleaf.org" xmlns:sec="https://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
    <head>
        <title>OAuth2登录</title>
        <meta charset="utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.5.3/css/bootstrap.min.css" rel="stylesheet">
    </head>
    <body>
        <div th:fragment="header">
            <nav class="navbar navbar-default">
                <div class="container">
                    <div class="container-fluid">
                        <div class="navbar-collapse collapse" id="navbar">
                        </div>
                    </div>
                </div>
            </nav>
        </div>
        <div class="container">
            <div th:if="${error}" class="alert alert-danger alert-dismissible" role="alert">
                <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 th:text="${error}" class="text-center"></h4>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">Authorize the client using <span style="font-family:monospace">grant_type</span>:</h3>
                </div>
                <ul class="list-group">
                    <li class="list-group-item">
                        <a href="/authorize?grantType=authorization_code" th:href="@{/authorize?grantType=authorization_code}"><span style="font-size:medium">授权码方式</span>&nbsp;&nbsp;<small class="text-muted">(Login to Spring Authorization Server using: user1/password)</small></a>
                    </li>
                    <li class="list-group-item">
                        <a href="/login/token?grantType=client_credentials" th:href="@{/login/token?grantType=client_credentials}"><span style="font-size:medium">客户端凭证方式</span></a>
                    </li>
                    <li class="list-group-item">
                        <a href="/login/token?grantType=password&userloginid=vybe8882&password=0c85ff2f8718ab9b151e105248b893b9" th:href="@{/login/token?grantType=password&userloginid=vybe8882&password=0c85ff2f8718ab9b151e105248b893b9}"><span style="font-size:medium">密码、手机、邮件等方式</span></a>
                    </li>
                </ul>
                <div th:if="${data}" class="panel-footer">
                    <h4>data.accessToken.tokenValue:</h4>
                    <table class="table table-condensed">
                        <tbody>
                        <tr class="row" th:if="${data.accessToken}">
                            <td th:text="${data.accessToken.tokenValue}">accessToken</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div th:if="${data}" class="panel-footer">
                    <h4>data.refreshToken.tokenValue:</h4>
                    <table class="table table-condensed">
                        <tbody>
                        <tr class="row" th:if="${data.refreshToken}">
                            <td th:text="${data.refreshToken.tokenValue}">refreshToken</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div th:if="${userInfo}" class="panel-footer">
                    <h4>userInfo:</h4>
                    <table class="table table-condensed">
                        <tbody>
                        <tr class="row">
                            <td th:text="${userInfo}">userInfo</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div th:if="${roles}" class="panel-footer">
                    <h4>roles:</h4>
                    <table class="table table-condensed">
                        <tbody>
                        <tr class="row">
                            <td th:text="${roles}">roles</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div th:if="${tips}" class="panel-footer">
                    <h4>tips:</h4>
                    <table class="table table-condensed">
                        <tbody>
                            <tr class="row">
                                <td th:text="${tips}">tips</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
        <script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.5.3/js/bootstrap.min.js"></script>
    </body>
</html>
